package com.dementors.view;

import android.content.Context;
import android.graphics.Bitmap;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.dementors.R;

/**
 * ***********************
 * author:raochen
 * time:2015/12/8.
 * name:
 * step:
 * ***********************
 */
public class RecyclerViewHeader extends LinearLayout {

    private Context context;
    private TextView tv_item_activity_title,tv_item_activity_time;
    private ImageView iv_item_activity_bigimg,iv_item_activity_icon;

    public RecyclerViewHeader(Context context) {
        this(context, null);
    }

    public RecyclerViewHeader(Context context, AttributeSet attrs) {
        this(context, attrs, 0);
    }

    public RecyclerViewHeader(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
        this.context=context;
        LayoutInflater.from(context).inflate(R.layout.recyclerviewheader,this,true);
        initView();//初始化控件

    }

    private void initView() {
        tv_item_activity_title = (TextView) findViewById(R.id.tv_item_activity_title);
        tv_item_activity_time = (TextView) findViewById(R.id.tv_item_activity_time);
        iv_item_activity_bigimg = (ImageView) findViewById(R.id.iv_item_activity_bigimg);
        iv_item_activity_icon = (ImageView) findViewById(R.id.iv_item_activity_icon);

    }
    //设置大图片
    public void setBigImg(Bitmap bitmap){
        iv_item_activity_bigimg.setImageBitmap(bitmap);
    }
    //设置小图标
    public void setIconImg(Bitmap bitmap){
        iv_item_activity_icon.setImageBitmap(bitmap);
    }
    //设置时间
    public void setTime(String time){
        tv_item_activity_time.setText(time);
    }


    //设置标题
    public void setTitle(String title){
        tv_item_activity_title.setText(title);
    }


}
